/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package newkfp;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author $alama
 */
@Entity
@Table(name = "exporter_factory")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ExporterFactory.findAll", query = "SELECT e FROM ExporterFactory e"),
     @NamedQuery(name = "ExporterFactory.factoriesByExporterId", query = "SELECT e FROM ExporterFactory e where e.idexporter = :idexporter"),
    @NamedQuery(name = "ExporterFactory.findByIdexporterFactory", query = "SELECT e FROM ExporterFactory e WHERE e.idexporterFactory = :idexporterFactory")})
public class ExporterFactory implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idexporter_factory")
    private Integer idexporterFactory;
    @JoinColumn(name = "idfactory", referencedColumnName = "idFactory")
    @ManyToOne
    private Factory idfactory;
    @JoinColumn(name = "idexporter", referencedColumnName = "idExporter")
    @ManyToOne
    private Exporter idexporter;

    public ExporterFactory() {
    }

    public ExporterFactory(Integer idexporterFactory) {
        this.idexporterFactory = idexporterFactory;
    }

    public Integer getIdexporterFactory() {
        return idexporterFactory;
    }

    public void setIdexporterFactory(Integer idexporterFactory) {
        this.idexporterFactory = idexporterFactory;
    }

    public Factory getIdfactory() {
        return idfactory;
    }

    public void setIdfactory(Factory idfactory) {
        this.idfactory = idfactory;
    }

    public Exporter getIdexporter() {
        return idexporter;
    }

    public void setIdexporter(Exporter idexporter) {
        this.idexporter = idexporter;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idexporterFactory != null ? idexporterFactory.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ExporterFactory)) {
            return false;
        }
        ExporterFactory other = (ExporterFactory) object;
        if ((this.idexporterFactory == null && other.idexporterFactory != null) || (this.idexporterFactory != null && !this.idexporterFactory.equals(other.idexporterFactory))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "newkfp.ExporterFactory[ idexporterFactory=" + idexporterFactory + " ]";
    }
    
}
